package com.hbnu.test;

import com.hbnu.pojo.TUser;
import org.springframework.jdbc.core.RowMapper;


import java.sql.ResultSet;
import java.sql.SQLException;

public class MyRowMapper implements RowMapper<TUser> {
    @Override
    public TUser mapRow(ResultSet resultSet,int i)throws SQLException{
        int id = resultSet.getInt("id");
        String name = resultSet.getString("name");
        String password = resultSet.getString("password");
        String addr = resultSet.getString("addr");
        double salary = resultSet.getDouble("salary");

        return new TUser(id,name,password,addr,salary);
    }
}





















